using System;
using System.Collections.Generic;
using System.Text;
using FireStarter.CodeGeneration;
using NUnit.Framework;

namespace FireStarter.Test.CodeGeneration
{
    [TestFixture]
    public class TestUiProjectTemplateLoader: TestBase
    {
        [Test]
        public void TestUiManager()
        {
            //---------------Set up test pack-------------------
            UiProjectTemplateLoader templateLoader = new UiProjectTemplateLoader();
            string namespaceName = GetRandomString();
            string boProjectName = GetRandomString();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            string contents = templateLoader.GetUiManager(namespaceName,boProjectName);
            //---------------Test Result -----------------------
            
            AssertUiManagerCorrect(contents, namespaceName, boProjectName);
        }

        public static void AssertUiManagerCorrect(string contents, string namespaceName, string boProjectName)
        {
            StringAssert.Contains(string.Format("using {0};", boProjectName),contents);
            StringAssert.Contains(string.Format("namespace {0}", namespaceName), contents);
        }
    }
}
